package com.juc.cyclicbarrier.cyclicbarrier2;

import java.util.concurrent.CyclicBarrier;

public class Run {

	public static void main(String[] args) throws InterruptedException {
		CyclicBarrier cbRef = new CyclicBarrier(2, new Runnable() {
			
			@Override
			public void run() {
			    System.out.println( "全来了 ！");
			}
		});
		
		for (int i = 0; i < 4; i++) {
			MyThread threadA1 = new MyThread(cbRef);
			threadA1.start();
			Thread.sleep(2000);
		}
	}
}
